package model

import "time"

type User struct {
	Id        uint32    `gorm:"column:id;type:int UNSIGNED;primaryKey;not null;"  form:"id" json:"id"`
	Mobile    string    `gorm:"column:mobile;type:char(11);comment:手机号;not null;"  form:"mobile" json:"mobile"`            // 手机号
	Password  string    `gorm:"column:password;type:varchar(32);comment:密码;not null;"  form:"password" json:"password"`    // 密码
	Name      string    `gorm:"column:name;type:varchar(20);comment:用户名;not null;"  form:"name" json:"name"`               // 用户名
	Status    int8      `gorm:"column:status;type:tinyint(1);comment:状态;not null;default:0;"  form:"status" json:"status"` // 状态
	CreatedAt time.Time `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);"  form:"created_at" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);"  form:"updated_at" json:"updated_at"`
	Delete    time.Time `gorm:"column:delete;type:datetime(3);default:NULL;"  form:"delete"  json:"delete"`
}

func (u User) TableName() string {
	return "user"
}
